package com.evenvi.nio;

public class TimeServer {
    private int port;

    public TimeServer(int port){
        this.port = port;
    }

    public void start(){
        MultiplexerTimeServer timeServer = new MultiplexerTimeServer(port);
        new Thread(timeServer, "NIO-MultiplexerTimeServer-001").start();
    }

    public static void main(String[] args) {
        if(args.length != 1)
        {
            System.out.println("Sage: " + TimeServer.class.getSimpleName() + " <port>");
            return;
        }

        int port = Integer.valueOf(args[0]);
        new TimeServer(port).start();

    }
}
